package gameEngine.com.state;

import java.sql.Date;

import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Paint.Style;
import android.view.KeyEvent;
import gameEngine.com.*;
import gameEngine.com.Actor.Actor;

public class StateLogo extends MainActivity {

	

	public static void SendMessageStateLogo(int type) {

		switch (type) {
		case MESSAGE_CTOR:
			if (fontsmall == null) {
				fontsmall = new BitmapFont("font/font_01.spr", true);
			}
			logoimage = loadImageFromAsset("image/logo.png");
			timeBeginCurrentState = System.currentTimeMillis();
			break;
		case MESSAGE_UPDATE:
			// if (splashImage == null)
			// splashImage = loadImageFromAsset("logo.png");
			if(frameCountCurrentState == 2){
				if (spriteIcon == null)
					spriteIcon = new Sprite("sprite/ui/icon.spr", true);
			}
			if(System.currentTimeMillis() - timeBeginCurrentState >4000)
	//		if (isKeyPressed(KeyEvent.KEYCODE_ENTER) || isTouchPressScreen())
				changeState(STATE_SPLASH);
			break;
		case MESSAGE_PAINT:
			mainCanvas.drawColor(Color.BLACK);

			
			mainCanvas.drawBitmap(logoimage,
					(SCREEN_WIDTH - logoimage.getWidth()) >> 1,
					(SCREEN_HEIGHT - logoimage.getHeight()) >> 1,null);

			break;
		case MESSAGE_DTOR:
			logoimage = null;
			break;
		}
	}

}
